package com.hzc.springchan.service;

import com.hzc.springchan.enums.LogOperation;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * 操作记录服务接口
 * @author chen990627
 * @date 2022/10/16
 */
public interface IOperationLogService {

    @Getter
    @Setter
    class OperationRequest {

        private Integer userId;

        private LogOperation operation;

        private Map<String, Object> paramMap;

        public OperationRequest who(Integer userId) {
            this.userId = userId;
            return this;
        }

        public OperationRequest how(LogOperation operation) {
            this.operation = operation;
            return this;
        }

        public OperationRequest extra(Map<String, Object> paramMap) {
            this.paramMap = paramMap;
            return this;
        }
    }

    /**
     * 操作记录
     *
     * @param operationRequest
     */
    void logOperation(OperationRequest operationRequest);
}
